<template>
  <div class="test">
    <div>message:{{ message }}</div>
    <div>doubleCount: {{ doubleCount }}</div>
    <div>Count: {{count}}</div>
    <button @click="add">add</button>
  </div>
</template>

<script>
import { computed, ref } from "vue";
export default {
  name: "TestComponent",
  setup() {
    const message = "hello world!!!";
    const count = ref(1);
    const doubleCount = computed(() => count.value * 2);
    const add = () => {
      console.log(111);
      count.value++;
    };
    return {
      message,
      doubleCount,
      add,
      count,
    };
  },
};
</script>

<style lang="scss" scoped>
.test {
  color: red;
}
</style>
